<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class ArticleflowViewArticleflow extends JView {

    function __construct($config = array()) {
        parent::__construct($config);
    }

    function display($tpl = null) {
        global $mainframe, $option;

        $user = & JFactory::getUser();
        $db = & JFactory::getDBO();
        $uri = & JFactory::getURI();

        $filter_state = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'word');
        $filter_catid = $mainframe->getUserStateFromRequest($option . 'filter_catid', 'filter_catid', 0, 'int');
        $search = $mainframe->getUserStateFromRequest($option .'search', 'search', '', 'string');
        $search = JString::strtolower($search);

        // Get data from the model
        $items = & $this->get('Data');
        $items_temp = & $this->get('Data_Temp_Edit');
      //  echo count($items_temp); die();
         //$items = & $this->get('Data',$user->getParam('role'));
        $total = & $this->get('Total');
        $pagination = & $this->get('Pagination');
    
        $javascript = 'onchange="document.adminForm.submit();"';
        // state filter
       // $lists['state'] = JHTML::_('grid.state', $filter_state, "Đang Xét Duyệt", "Đang biên tập","Hoàn Tất");
        $lists['state'] = ArticleflowHelper::buildStateList($filter_state);
        $lists['catid'] = ArticleflowHelper::buildListCategory($filter_catid, 'filter_catid', 1);
        // $lists['catid'] = ::buildCategory($filter_catid, 'filter_catid', 1);
        // search filter
        $lists['search'] = $search;

        $this->assignRef('lists', $lists);
        $this->assignRef('items', $items);
        $this->assignRef('items_temp', $items_temp);
        $this->assignRef('pagination', $pagination);


        parent::display($tpl);
    }

}

?>
